package pl.makimo.fuzzy.linguistics;

import pl.makimo.fuzzy.sets.ContinuousFuzzySet;
import pl.makimo.fuzzy.sets.CrispSet;

public class Quantifier {
	public String label;
	public ContinuousFuzzySet set;
	public boolean relative;
	
	@Override
	public String toString() {
		return label;
	}
	
	public static Quantifier make(ContinuousFuzzySet set, String label, CrispSet data, boolean relative) {
		Quantifier quantifier = new Quantifier();
		quantifier.set = set;
		quantifier.label = label;
		quantifier.relative = relative;
		
		if (quantifier.relative == true) {
			quantifier.set.setMin(0);
			quantifier.set.setMax(1);
		} else {
			quantifier.set.setMin(0);
			quantifier.set.setMax(data.size());
		}
		
		return quantifier;
	}		
}
